#include <stdlib.h>
#include <string.h>

int main(int argc,char *argv[]){
    char *return_val=0;
    const size_t bufsize = strlen(argv[0]) + 1;
    char *buf = (char *)malloc(bufsize);
    if (!buf){
        return EXIT_FAILURE;
    }
    /* ... */
    strcpy(buf,argv[0]);
    /* ... */
    free(buf);
    return EXIT_SUCCESS;
}